package com.example.pickupclosefirstdemo.aroutersecond;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.example.pickupclosefirstdemo.R;
import com.example.pickupclosefirstdemo.base.BaseActivity;
import com.example.pickupclosefirstdemo.databinding.ActivityArouterSecondBinding;
import com.example.pickupclosefirstdemo.main.MainActivity;
import com.example.pickupclosefirstdemo.util.LogUtil;

import static com.example.pickupclosefirstdemo.bean.Constants.AROUTER_ACT_TO_AROUTERSECONDACTIVITY;

@Route(path = AROUTER_ACT_TO_AROUTERSECONDACTIVITY)
public class ArouterSecondActivity extends BaseActivity<ActivityArouterSecondBinding> {

    @Autowired
    public String key;

    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_arouter_second;
    }

    @Override
    public void initView() {
        binding.setActivity(this);
        LogUtil.e("接收到key-->" + key);
    }

    @Override
    public void initData() {

    }

    public void backClick(View view){
        switch (view.getId()){
            case R.id.tvModuleResult:
                Intent intent = new Intent(ArouterSecondActivity.this, MainActivity.class);
                intent.putExtra("module_result","雷诺");
                setResult(RESULT_OK,intent);
                finish();
                break;
                default:
        }
    }

}
